<?php

class tplFormedit extends StudyBuddy\Template\Template {

    /**
     * Important: names of form fields
     * must match the keys in this array
     * for example 'title', 'body', 'tags'
     * must be names of form fields
     *
     * @var array
     */
    protected static $vars = array(
        'token' => '', //1
        'required' => 'required', //2
        'title' => '', //3
        'title_l' => 'Edit question', // 4
        'title_d' => '',
        'title_e' => '', // 6
        'title_c' => 'Edit question', // 7
        'qbody' => '', //8
        'qbody_e' => '', //9
        'reason' => '', //10
        'reason_l' => 'Reason for editing', //11
        'reason_d' => 'Enter short summary of reason for this edit', //12
        'reason_e' => '', //13
        'submit' => 'Save', //14
        'rtype' => 'q', //15
        'formError' => '', // 16
        'hidden' => '', //17
        'id_title' => 'title_off', //18
        'id' => '', //19
        'subject' => '', // 20
        'subject_l' => 'Subject', // 21
        'level' => '', // 22
        'level_l' => 'Level', // 23
        'chapter' => '', // 24
        'chapter_l' => 'Chapter', // 25
        'dif' => '', // 26
        'dif_l' => 'Difficult' // 27
    );
    protected static $tpl = '
<script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        relative_urls : false,
        width : "594",
        height : "300",
        object_resizing : false,
        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,jbimages,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
//        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1 : "equation,jbimages",
//        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,cleanup,|,equation,|,image",
//        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "",
//        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "",
//        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,equation,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "",
//        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
//        theme_advanced_statusbar_location : "bottom",
        theme_advanced_statusbar_location : false,
        theme_advanced_resizing : false,

        file_browser_callback : "ajaxfilemanager",

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title : "Bold text", inline : "b"},
            {title : "Red text", inline : "span", styles : {color : "#ff0000"}},
            {title : "Red header", block : "h1", styles : {color : "#ff0000"}},
            {title : "Example 1", inline : "span", classes : "example1"},
            {title : "Example 2", inline : "span", classes : "example2"},
            {title : "Table styles"},
            {title : "Table row 1", selector : "tr", classes : "tablerow1"}
        ],

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        },

        custom_elements: "m",
        extended_valid_elements: "m"
    });
</script>
<div id="edit_form">
    <div class="ask-tit">
        Edit question
    </div>		
    <div class="form_error">%16$s</div>
    <form class="qa_form" name="editor" method="POST" action="/index.php" accept-charset="utf-8">
    <input type="hidden" name="a" value="editor">	
    <input type="hidden" name="token" value="%1$s">
    <input type="hidden" name="rtype" value="%15$s">
    <input type="hidden" name="rid" value="%19$s">

    <div class="ask-tag">
        <div class="atag-left">%4$s :</div>
        <div class="atag-mid">
            <input autocomplete="off" id="id_title" class="title_c%15$s atag-txt" type="text" name="title" size="80" value="%3$s" %16$s>
            <div class="atag-txt-right"></div>
        </div>
    </div>
    <!-- start editor -->
    <div class="ask-tag" style="overflow:hidden">
        <textarea id="id_qbody" rows="6" cols="40" class="com_body%15$s" name="qbody" %16$s>%8$s</textarea>
    </div>
    <!-- end editor -->
    <div class="ctl-nav">
        <div class="ctl-nav-ct" style="position:relative">	                            
            <select name="level" onchange="oSL.getSubject(this.options[this.selectedIndex].value)" style="border:none; background:transparent; padding:0 3px 3px 0; width:86px; position:relative">
                <option value="1">All Sec</option>
                %22$s
            </select>
            <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
        </div>
        <div class="ctl-nav-solid">
            <img alt="" src="/images/2/icon/solid.gif" />
        </div>
        <div class="ctl-nav-ct" style="position:relative">	
            <div id="subject_container" style="position:relative">                            
                <select name="subject" onchange="oSL.getChapter(this.options[this.selectedIndex].value)" style="border:none; background:transparent; padding:0 3px 3px 0; width:86px; position:relative">
                    <option value="">All Subject</option>
                    %20$s
                </select>
                <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
            </div>
        </div>
        <div class="ctl-nav-solid">
            <img alt="" src="/images/2/icon/solid.gif" />
        </div>
        <div class="ctl-nav-ct">	                            
            <div id="chapter_container" style="position:relative">
                <select name="chapter" style="border:none; background:transparent; padding:0 3px 3px 0; width:86px; position:relative">
                    <option value="">All Chapter</option>
                    %24$s
                </select>
                <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
            </div>
        </div>
        %26$s	                        
    </div>    
    <div class="ask-tag" id="id_ask-tag">
        <div class="atag-left">%11$s : (* %2$s)</div>
        <div class="atag-mid">
            <input id="id_reason" type="text" name="reason" class="tags_c%15$s atag-txt" size="80" value="%10$s" %16$s> 
            <div class="atag-txt-right" style="float:right"></div>
        </div>
        <div class="atag-right">
            <input id="dostuff" name="submit" type="submit" class="ask-btn" value="" %14$s style="border:none; background-color:transparent" />
        </div>
    </div>
    </form>
</div>';

}
